<template>
  <tr>
    <th><input type="checkbox" v-model="list.checked"/> <span></span></th>
    <th>{{list.name}}</th>
    <th>{{list.price}}</th>
    <th>
      <button @click="list.num++">++</button>
      {{list.num}}
      <button @click="list.num--">--</button>
    </th>
    <th>{{total}}</th>
    <th><button @click="delList(list.name)">删除</button></th>
  </tr>
</template>

<script>
export default {
  props: ['list'],
  data () {
    return {
    }
  },
  computed: {
    total () {
      return this.list.num * this.list.price
    }
  },

  created () {},

  methods: {
    delList (n) {
      this.$emit('delList', n)
    }
  }
}
</script>

<style scoped lang="less"></style>
